<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>背景</title>
    <style>
        div{
            width: 1000px;
            height: 700px;
            border: 1px solid skyblue;
            /*默认是平铺的*/
            background-image: url("./images/bg1.jpg");
        }
        .div1{
            background-repeat: no-repeat;
            /*background-size: contain; !* 类似 100%*!*/
            background-size: cover;
        }
    </style>
</head>
<body>
<div class="div1"></div>
<div class="div2"></div>
<div class="div3"></div>
</body>
</html>